﻿using MgSoft.K3Cloud.WebApi.Dto;
using System;
using System.Collections.Generic;
using System.Text;

namespace MgSoft.K3Cloud.WebApi
{
    public interface IWebApi: IApi
    {
        /// <summary>
        /// 分配 (只有基础资料能使用)
        /// </summary>
        /// <param name="AllocateInputDto"></param>
        /// <returns></returns>
        List<AllocateOutputDto> Allocate(AllocateInputDto allotInputDto);
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="auditInputDto"></param>
        /// <returns></returns>
        List<AuditOutputDto> Audit(AuditInputDto auditInputDto);
        /// <summary>
        /// 批量保存
        /// </summary>
        /// <param name="batchSaveInputDto"></param>
        /// <returns></returns>
        BatchSaveOutputDto BatchSave(BatchSaveInputDto batchSaveInputDto);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="deleteInputDto"></param>
        /// <returns></returns>
        List<DeleteOutputDto> Delete(DeleteInputDto deleteInputDto);
        /// <summary>
        /// 暂存
        /// </summary>
        /// <param name="draftInputDto"></param>
        /// <returns></returns>
        List<DraftOutputDto> Draft(DraftInputDto draftInputDto);
        bool Exist(string filterString, string fileds = "FId");
        T Get<T>(string formId, long id) where T : class;
        T Get<T>(string formId, string number) where T : class;
        T Get<T>(GetInputDto getInputDto) where T : class;
        List<T> GetList<T>(GetListInputDto getListInputDto) where T : class, new();
        /// <summary>
        /// 下推
        /// </summary>
        /// <param name="PushInputDto"></param>
        /// <returns></returns>
        List<PushOutputDto> Push(PushInputDto PushInputDto);
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="saveInputDto"></param>
        /// <returns></returns>
        List<SaveOutPutDto> Save(SaveInputDto saveInputDto);
        /// <summary>
        /// 保存
        /// </summary>
        /// <typeparam name="TNeedReturnDataOutputDto">需要返回的字段</typeparam>
        /// <param name="saveInputDto"></param>
        /// <remarks>用于填写了NeedReturnDataOutputDto属性的保存</remarks>
        /// <returns></returns>
        Tuple<List<SaveOutPutDto>, List<TNeedReturnDataOutputDto>> Save<TNeedReturnDataOutputDto>(SaveInputDto saveInputDto) where TNeedReturnDataOutputDto : NeedReturnDataOutputDto;
        /// <summary>
        /// 提交
        /// </summary>
        /// <param name="submitInputDto"></param>
        /// <returns></returns>
        List<SubmitOutputDto> Submit(SubmitInputDto submitInputDto);
        /// <summary>
        /// 反审核
        /// </summary>
        /// <param name="unAuditInputDto"></param>
        /// <returns></returns>
        List<UnAuditOutputDto> UnAudit(UnAuditInputDto unAuditInputDto);
    }
}
